package com.movie.controller.SysRoleController;

import com.movie.beans.SysMenuRole;
import com.movie.service.SysMenuRoleService;
import com.movie.service.SysUserRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @Description : 角色控制层
 * @Author : nlw
 * @Date : 2021/8/27
 */
@Controller
@RequestMapping(value = "/system/role")
public class SysRoleController {
    @Autowired
    private SysUserRoleService userRoleService;
    @Autowired
    private SysMenuRoleService menuRoleService;

    @PostMapping("/list")
    @ResponseBody
    public List<SysMenuRole> getSysUserRole(Long roleId){
//        System.out.println(userRoleService.selectRoleByUserId(userId));
        return menuRoleService.selectMenuByRole(roleId);
    }
}
